#ifndef ANSI_INTERFACE_H__
#define ANSI_INTERFACE_H__

#include "ApiTime.h"
#include "DMUartTypes.h"
#include "LogSystem/Log.h"

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef unsigned int uint32_t;


#define LOGD(...)  do { 					 \
	MLSWriteLog((ELOGPRI_DBG, __VA_ARGS__)); \
} while (0)

#define LOGE(...)  do { 					 \
	MLSWriteLog((ELOGPRI_ERR, __VA_ARGS__)); \
} while (0)
#define LOGI(...)  
#define LOGW(...)

extern DMInt32u get_current_time(void);
extern void msleep(DMInt32u msec);
extern void nsleep(DMInt32u usec);

extern unsigned short ansi_htons(unsigned short n);

extern int32_t ansi_meter_prefetch(uint8_t port, uint8_t *buf, uint32_t size);
extern int32_t ansi_meter_read(uint8_t port, uint8_t *buf, uint32_t len);
extern void ansi_meter_write(uint8_t port, uint8_t *buf, uint32_t len);
extern void ansi_meter_flush(uint8_t port);
extern void ansi_meter_init(uint8_t port);


#endif
